package com.itheima.playGame;

public class PlayTest {
    public static void main(String[] args) {

        //匿名捏不累：
        PlayInterface p = new PlayInterface() {
            @Override
            public void playGame() {
                System.out.println("打游戏");
            }
        };
        p.playGame();

        //匿名内部类且匿名对象:
        new PlayInterface(){
            @Override
            public void playGame() {
                System.out.println("打啥游戏");
            }
        }.playGame();


        //匿名内部类且匿名对象的  线程举例：
        new Thread(){
            @Override
            public void run() {
                System.out.println(Thread.currentThread().getName());
            }
        }.start();
    }
}
